<!--
 *                   江城子 . 程序员之歌
 *
 *               十年生死两茫茫，写程序，到天亮。
 *                   千行代码，Bug何处藏。
 *               纵使上线又怎样，朝令改，夕断肠。
 *
 *               领导每天新想法，天天改，日日忙。
 *                   相顾无言，惟有泪千行。
 *               每晚灯火阑珊处，夜难寐，加班狂。
 *
 *
 * @Descripttion:
 * @version:
 * @Date: 2022-03-16 10:04:51
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2022-03-16 10:21:48
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 -->
<template>
  <drawer-frame
    cancel-text="关闭"
    submit-text="拷贝链接"
    @close="$emit('close')"
    @submit="handleCopy(page.url, $event)"
  >
    <span slot="title" class="title">
      <svg-icon icon-class="qrcode"></svg-icon>
      {{ page.title }}
    </span>
    <iframe
      :src="page.url"
      frameborder="0"
      style="
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
      "
    ></iframe>
  </drawer-frame>
</template>
<script>
import clip from '@/utils/clipboard'
export default {
  props: {
    page: {
      type: Object,
      default: () => ({}),
    },
  },
  methods: {
    handleCopy(text, event) {
      clip(text, event)
    },
  },
}
</script>
